package zhieasy.cn.xpu_helper.controller.initiation;

import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import zhieasy.cn.common.utils.StorageUtil;
import zhieasy.cn.common.vo.ResultVO;

/**
 * @author DaHang
 * @date 2020/7/31 20:17
 * 用来获取开学助手上传图片token以及上传路径的controller
 */
@RestController("InitiationObjectUploadController")
@RequestMapping("initiation/objectUpload")
@Api(tags = "开学助手模块，论坛图片上传接口")
public class InitiationUploadController {

    private final StorageUtil storageUtil;

    public InitiationUploadController(StorageUtil storageUtil) {
        this.storageUtil = storageUtil;
    }

    /**
     * 获取上传object的路径以及上传所需要携带的token
     */
    @RequestMapping("/tokenAndUrl")
    public ResultVO getTokenAndUrl(){
        return storageUtil.getTokenAndUrlInInitiation();
    }
}
